package com.kaoyaya.util;

import android.content.Context;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan;

public class TextEffect {
	public SpannableString ss;
	private Context context;

	public TextEffect(Context context,String info) {
		this.context = context;
		ss = new SpannableString(info);
	}

	// 字体改变   3个参数分别是起始位置 结束位置 字体大小（dip）
	public void sizeEffect(int start, int end, int size) {
		ss.setSpan(new AbsoluteSizeSpan(size, true), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

	}

	// 颜色改变   3个参数分别是起始位置 结束位置 颜色Id
	public void colorEffect(int start, int end, int colorId) {
		ss.setSpan(new ForegroundColorSpan(context.getResources().getColor(colorId)), start, end, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);

	

	}
}

